<template>
    <el-input class="search-input"
        v-model.trim="option.value"
        @blur="blurSearchItem(option, index)"
        @keyup.enter.native="blurSearchItem(option, index)"
        @change="changeInputSearchItem">
    </el-input>
</template>

<script>
import normalMixin from "../mixin/normalMixin";
export default {
    name: "searchInput",
    mixins: [normalMixin],
    methods: {
        /**
         * Input组件change事件触发的事件
         * @param {String} value input返回的数据结构
         */
        changeInputSearchItem(value) {
            // 返回配置 String 类型
            if (this.option.changeMethod) this.option.changeMethod(value);
        }
    }
}
</script>
